<link rel="stylesheet" href="__PUBLIC__/admin/material/css/index.css?v=20221110&times=111" />
<link rel="stylesheet" href="__PUBLIC__/admin/material_media/css/index.css?v=111141&times=111" />
<style>
    .main-box-body .navs .active {
        background: azure;
        color: #03a9f4;
        border: 1px solid #03a9f4;
        border-radius: 5px;
    }
</style>
<header class="main-box-header clearfix">
    <div class="pull-right">
        <button type="button" class="btn btn-warning"> <input class="checkbox check-all" type="checkbox"
                style="display: inline-block;margin-top: -2px;vertical-align: middle;"> 全选 </button>
        <!-- <button type="button" class="btn btn-warning"> <input class="checkbox check-all" type="checkbox" style="display: inline-block;margin-top: -2px;vertical-align: middle;"> 全选 </button> -->
        <button type="button" class="btn btn-primary" id="createUrl">
            <i class="fa fa-plus"></i> 添加素材 <span class="caret"></span>
        </button>
        <button type="button" class="btn btn-primary" id="uploadTEXT" style="display: none;">
            <i class="fa fa-plus"></i> 添加 <span class="caret"></span>
        </button>
        <button class="btn btn-danger ajax-post confirm" url="{:url('del')}" target-form="ids">删 除</button>
    </div>
    {include file="book/_pub_search" /}
</header>
<div class="main-box-body clearfix">
    {:widget('admin/Book/book', $book_id)}
    {:widget('admin/Book/cate', $cate_type)}

    <div class="baiduTable">
        <div class="row toolTip">
			<div class="col-md-12">
				<table class="table table-hover table-bordered">
					<thead>
						<tr>
							<th width="20px"><input class="checkbox check-all" type="checkbox" style="display:inline"></th>
							<th width="35px">序号</th>
							<th width="190px">文件名</th>
                            <th width="220">创建人/归属人</th>
                            <th width="100">选用</th>
                            <th width="140px">记录</th>
							<th width="100px">操作</th>
						</tr>
					</thead>
					<tbody>
						{volist name="list" id="vo" mod="3" }
						{eq name="mod" value="0"}
						<tr>
							<td><input class="ids row-selected" type="checkbox" name="id[]" value="{$vo['id']}"></td>
							<td class="title">{$vo.num}</td>
							<td class="toolTip" style="font-size: 18px;" onclick="editreferral(this)" data-json='{:json_encode($vo)}'>
								{$vo.title}
							</td>
                            <td>{$userlist[$vo['create_uid']]??$vo['create_uid']}

                                / {$userlist[$vo['uid']]??$vo['uid']}
                            </td>
                            <td {if $vo['selection_uid'] == 0}onclick="selection({$vo['id']})"{/if}>{if $vo['selection_uid'] == 0}<i class="fa fa-edit"></i> 未选用{else/} <span  style="color:#ff3c00">已选用</span> {/if}</td>
                            
							<td>
                                {if $vo['selection_uid'] == 0}
                                -
                                {else/}
                                {:date("Y-m-d H:i:s", $vo['selection_time'])}<br>{$userlist[$vo['selection_uid']]??$vo['selection_uid']}选用
                                {/if}
                                
                            </td>
							<td style="">
								<a href="#" style="margin-right: 5px;" class="accept" onclick="playAudio('{$vo.content}',this)" title="{$vo.content}" >试听</a>
								<a href="JavaScript:;" onclick="downMedia('{$vo.content}',{$vo.id})"><i class="fa fa-download"></i>下载  </a>
							</td>
						</tr>
						{/eq}
						{/volist}
						
					</tbody>
				</table>
			</div>
		
		</div>	
		<audio style="display: none;" src="" id="oAudio"></audio>
		{$page}
</div>




<div class="modal fade" id="create-referral-link-modal">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">×</span></button>
                <span style="font-size: 20px;"><span id="referralname">添加</span></span>
            </div>
            <div class="modal-body">
                <div data-bind="visible: loading" class="loading-panel" style="display: none;">
                    <i class="fa fa-spin fa-spinner"></i>
                </div>
                <form class="form-horizontal modelform">

                   
                    <input type="hidden" name="cate_type" value="{$cate_type}">
                    <input type="hidden" name="book_id" value="{$book_id}">
                    <input type="hidden" name="id" id="createspreadid">
                   

                    <div class="form-group">
						<label class="control-label col-sm-2">标题</label>
						<div class="col-sm-8">
							<input type="text" class="form-control"  id="audio_title"  name="title" value=""  placeholder="多个文件时以英文,分开"/>
						</div>
					</div>

					<div class="form-group">
						<label class="control-label col-sm-2">音频</label>
						<input type="hidden" class="layui-input content" name="content" id="audio_content">
						<!-- <input type="hidden" class="layui-input content" name="title" id="audio_title"> -->
						<div class="col-lg-9">
							<button type="button" class="btn btn-primary" id="audio_btn">上传</button>
							<div class="layui-upload-list">
							</div>
						</div>
					</div>

                </form>
            </div>
            <div class="modal-footer">
                <button type="button" id="createreferral" class="btn btn-primary ">提交</button>
            </div>
        </div>
    </div>
</div>
